package top.chenbn.aclservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 权限
 *
 * @author testjava
 * @since 2020-08-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("acl_permission")
@ApiModel(value = "Permission对象", description = "权限")
public class Permission implements Serializable {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(value = "编号")
  @TableId(value = "id", type = IdType.ID_WORKER_STR)
  private String id;

  @ApiModelProperty(value = "所属上级")
  private String pid;

  @ApiModelProperty(value = "名称")
  private String name;

  @ApiModelProperty(value = "类型(1:菜单,2:按钮)")
  private Integer type;

  @ApiModelProperty(value = "权限值")
  private String permissionValue;

  @ApiModelProperty(value = "访问路径")
  private String path;

  @ApiModelProperty(value = "组件路径")
  private String component;

  @ApiModelProperty(value = "图标")
  private String icon;

  @ApiModelProperty(value = "状态(0:禁止,1:正常)")
  private Integer status;

  @ApiModelProperty(value = "层级")
  @TableField(exist = false)
  private Integer level;

  @ApiModelProperty(value = "下级")
  @TableField(exist = false)
  private List<Permission> children;

  @ApiModelProperty(value = "是否选中")
  @TableField(exist = false)
  private boolean isSelect;

  @ApiModelProperty(value = "逻辑删除 1（true）已删除， 0（false）未删除")
  private Boolean isDeleted;

  @ApiModelProperty(value = "创建时间")
  private Date gmtCreate;

  @ApiModelProperty(value = "更新时间")
  private Date gmtModified;
}
